﻿@{
    ViewBag.Title = "EditProjectRole";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<section id="content" role="main">
        








        
            
                <header>
                    <div id="proj-config-return-link" class="ops-cont">
        <ul class="ops">
            <li>
                <a id="back-lnk" class="back-to-proj-config button first last" href="/plugins/servlet/project-config/AN/summary"><span class="icon icon-back"><span>Back to project: Angel</span></span>Back to project: Angel</a>
            </li>
        </ul>
    </div>
<h1 id="admin-page-heading">Users</h1>
                </header>
            
            <div class="content-container">
                

                <div class="content-body aui-panel">
                    

<script type="text/javascript" language="JavaScript">

    var projectSelectShown = false;
    var projectRoleIds = new Array('10002', '10101', '10001', '10000');

    function selectProject(projectIds) {
        document.forms['edituserprojectroles'].action = 'EditUserProjectRoles!refresh.jspa';
        document.getElementById("projects_to_add").value = projectIds;
        document.forms['edituserprojectroles'].submit();
        return false;
    }

    function unselectRoleForCategory(categoryId, roleId) {
        var categoryTDs = getElementsByName("td", "category_" + categoryId);

        var controlCheckbox = document.getElementById(roleId + "_check_" + categoryId);
        var check = controlCheckbox.checked;

        // run through all the checkboxes in the row and uncheck
        for (var i = 0; i < categoryTDs.length; i++) {
            var categoryTD = categoryTDs[i];
            for (var j = 0; j < categoryTD.childNodes.length; j++) {
                var child = categoryTD.childNodes[j];

                if (child.type && child.type.indexOf("checkbox") != -1) {
                    if (child.id.indexOf("_" + roleId) != -1) {
                        child.checked = check;
                    }
                }
            }
        }

        return false;
    }

    function getElementsByName(tag, name) {
        var elem = document.getElementsByTagName(tag);
        var arr = new Array();
        for (i = 0, iarr = 0; i < elem.length; i++) {
            att = elem[i].getAttribute("name");
            if (att == name) {
                arr[iarr] = elem[i];
                iarr++;
            }
        }
        return arr;
    }

    function setProjectSelectTop() {
        var projectSelect = document.getElementById("projectselect");
        projectSelect.style.top = findPos(document.getElementById("add_project_link"))[1];
    }

    function findPos(obj) {
        var curleft = curtop = 0;
        if (obj.offsetParent) {
            curleft = obj.offsetLeft;
            curtop = obj.offsetTop;
            while (obj = obj.offsetParent) {
                curleft += obj.offsetLeft;
                curtop += obj.offsetTop;
            }
        }
        return [curleft, curtop];
    }

</script>


















	
	<table class="jiraform maxWidth" 
    >
	

	
	<tr class="titlerow">
		<td colspan="2" class="jiraformheader">
        
            








    
    
            <a class="help-lnk" href="https://docs.atlassian.com/jira/docs-051/Managing+Users#Assigning+a+User+to+a+Project+Role" target="_jirahelp">
    
            
                
            
            <img src="/s/en_US-vj4gfy/782/3/_/images/icons/ico_help.png" width="16" height="16"
            
            
                
                    
                    
                        align=right
                    
                
            
            border="0" alt="Get help!"
            title="Get online help about Managing Users"/></a>



        
        <h3 class="formtitle">Edit Project Roles for User: Bui Anh Hoa</h3>
        
        </td>
	</tr>
	
	
	<tr class="descriptionrow">
		<td colspan="2" class="jiraformheader">
            <div class="desc-wrap">
        This screen allows you to add/remove a user from a project role by ticking/unticking the checkboxes.<br/>
        Note: A group name (shown in brackets) indicates that the group is a member of the project role, and the user is a member of the group; so the user is an indirect member of the project role.
    </div>
        </td>
	</tr>
	
	

	
	
    
     
    <tr class="hidden"><td colspan="2"></td></tr>
	
    
    
    
        
    



    

    


<tr class="hidden"><td>



<input type="hidden"
       
       
           id="returnUrl"
       
       name="returnUrl"
      
         value="ViewUser.jspa"
         
      
     
        
    
/>

</td></tr>


        
    
	</table>
	



<form method="post" action="EditUserProjectRoles.jspa" name='edituserprojectroles' class="aui">



<input type="hidden"
       
       
           id="atl_token"
       
       name="atl_token"
      
         value="BPZI-XZK9-RUJW-161X|cded609727f41f59f452acc94d64488dbd09601e|lin"
         
      
     
        
    
/>



    











<div class="aui-message info"><span class="aui-icon icon-info"></span>
            <div id="add_project_link" class="twixi-block collapsed">
                <p>The initial view of this screen displays all the projects where the user is a member of one or more project roles. To display more projects on this screen, click the Display Project link and select the project or project category you want to include.</p>
                <div class="twixi-trigger">
                    <strong title="add project to view"><span class="icon icon-twixi"></span>Display Project</strong>
                </div>
                <div id="projectselect" class="twixi-content">
                    
                    <ul>
                    
                    </ul>
                    <h5>Uncategorized Projects:</h5>
                    <ul>
                    
                        
                    
                    </ul>
                </div>
            </div>
        </div>

    <table id="projecttable" class="aui aui-table-rowhover">
        <thead>
            <tr>
                <th width="25%">
                    Projects
                </th>
                
                    <th width="18%">
                        Administrators
                    </th>
                
                    <th width="18%">
                        AngelRole
                    </th>
                
                    <th width="18%">
                        Developers
                    </th>
                
                    <th width="18%">
                        Users
                    </th>
                
            </tr>
        </thead>

        
        <tbody>
            <tr class="totals">
                <td>
                    
                    
                        <strong>Uncategorized Projects</strong>
                    
                </td>
                
                    <td>
                        <input type="checkbox" id="10002_check_0"
                               onclick="unselectRoleForCategory(0, 10002 );"/>
                    </td>
                
                    <td>
                        <input type="checkbox" id="10101_check_0"
                               onclick="unselectRoleForCategory(0, 10101 );"/>
                    </td>
                
                    <td>
                        <input type="checkbox" id="10001_check_0"
                               onclick="unselectRoleForCategory(0, 10001 );"/>
                    </td>
                
                    <td>
                        <input type="checkbox" id="10000_check_0"
                               onclick="unselectRoleForCategory(0, 10000 );"/>
                    </td>
                
            </tr>
        </tbody>
        <tbody>
        
            <tr name="project" id="project_10000">
                <td>
                    Angel
                    <input type="hidden" id="project_shown" name="project_shown" value="10000"/>
                </td>
                
                    <td name="category_0">
                        <input type="checkbox"
                               id="10000_10002"
                               name="10000_10002"
                                 />
                        <input type="hidden"
                               id="10000_10002_orig"
                               name="10000_10002_orig"
                               value="false"/>
                        
                    </td>
                
                    <td name="category_0">
                        <input type="checkbox"
                               id="10000_10101"
                               name="10000_10101"
                                 />
                        <input type="hidden"
                               id="10000_10101_orig"
                               name="10000_10101_orig"
                               value="false"/>
                        
                    </td>
                
                    <td name="category_0">
                        <input type="checkbox"
                               id="10000_10001"
                               name="10000_10001"
                                 />
                        <input type="hidden"
                               id="10000_10001_orig"
                               name="10000_10001_orig"
                               value="false"/>
                        
                    </td>
                
                    <td name="category_0">
                        <input type="checkbox"
                               id="10000_10000"
                               name="10000_10000"
                                 />
                        <input type="hidden"
                               id="10000_10000_orig"
                               name="10000_10000_orig"
                               value="false"/>
                        
                            <span class="secondary-text" title="Associated to groups:jira-users">
                                (jira-users)
                            </span>
                        
                    </td>
                
            </tr>
        
        </tbody>
        
    </table>
<div class="buttons-container">
    @Html.ActionLink("Save", "RoleDetailOfUser", "Role", new { @class = "aui-button" })
    @Html.ActionLink("Cancel", "RoleDetailOfUser", "Role", new { @class = "aui-button-cancel", id = "cancelButton" })
</div>
</form>
                </div>
            </div>
        
    </section>

